package com.zhiche.lisa.mdm.service.impl;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.zhiche.lisa.mdm.dao.mapper.CardIssuerTypeMapper;
import com.zhiche.lisa.mdm.dao.model.CardIssuerType;
import com.zhiche.lisa.mdm.service.ICardIssuerTypeService;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * <p>
 * 发卡方类型 服务实现类
 * </p>
 *
 * @author qichao
 * @since 2018-06-18
 */
@Service
public class CardIssuerTypeServiceImpl extends ServiceImpl<CardIssuerTypeMapper, CardIssuerType> implements ICardIssuerTypeService {

    /**
     * 根据类型名称查询
     * @param val
     * @return
     */
    @Override
    public List<CardIssuerType> selectListByValue(String val){
        EntityWrapper<CardIssuerType> ew = new EntityWrapper<>();
        if (!StringUtils.isEmpty(val)) {
            ew.like("value", val);
        }
        return this.selectList(ew);
    }

    /**
     * 根据类型编码查询
     * @param code
     * @return
     */
    @Override
    public List<CardIssuerType> selectListByCode(String code) {
        EntityWrapper<CardIssuerType> ew = new EntityWrapper<>();
        if (!StringUtils.isEmpty(code)) {
            ew.like("code", code);
        }
        return this.selectList(ew);
    }

}
